from sqlalchemy.orm import sessionmaker, scoped_session
from orm01 import engine, Student
session_factory = sessionmaker(bind=engine)
Session = scoped_session(session_factory)
Session.query(Student).filter(Student.age > 25).update({"name": "菜菜"})
# filter_by 不用写类名,但必须写=, filter必须写类名
Session.query(Student).filter_by(name="崔杰").update({Student.name: Student.name + "099"}, synchronize_session=False)
Session.commit()

